Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Friend Class tipo_Cambio
	Inherits System.Windows.Forms.Form
	'UPGRADE_WARNING: Form event tipo_Cambio.Activate has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
	Private Sub tipo_Cambio_Activated(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Activated
		'Activar
		nombreform = Me.Name
	End Sub
	
	Private Sub tipo_Cambio_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		'txt_referencia.SetFocus
		dtp_tipoCambio._Value = VB.Day(Now) & "-" & Month(Now) & "-" & Year(Now)
	End Sub
	Private Sub cmd_guardar_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmd_guardar.Click
		Dim aux, fecha As String
		
		fecha = dtp_tipoCambio.Year & "/" & dtp_tipoCambio.Month & "/" & dtp_tipoCambio.Day
		If cmd_guardar.Text = "EDITAR" Then
			aux = "tipo_us = '" & txt_cambio.Text & "', referencia='" & txt_referencia.Text & "',fecha='" & fecha & "'"
			If txt_cambio.Text <> "" Then
				Call UpdateCostos("tipo_cambio", aux, "cod_tipoCambio=" & lblId.Text, 0)
				Call mensajes(5) : Me.Close()
			Else
				Call mensajes(9)
			End If
		Else
			aux = "'','" & txt_cambio.Text & "', '" & txt_referencia.Text & "','" & fecha & "'"
			Call insertAdd("tipo_cambio", aux)
			Call mensajes(5) : Me.Close()
		End If
		cargar()
		
		
	End Sub
	
	Sub cargar()
		band = 2
		Me.Close()
		'UPGRADE_ISSUE: Unload lista was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="875EBAD7-D704-4539-9969-BC7DBDAA62A2"'
		Unload(lista)
		'UPGRADE_WARNING: Couldn't resolve default property of object lista.Show. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
		lista.Show()
	End Sub
End Class